package com.example.todo_app;

import de.htwds.emrolab.mada.activities.MadaArrayAdapter;
import android.os.Bundle;
import android.app.Activity;
import android.util.Log;
import android.util.TypedValue;
import android.view.Menu;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.NumberPicker;

public class DetailActivity extends Activity {
	
	private MadaArrayAdapter mada = MadaArrayAdapter.getInstance();
	private NumberPicker np;
	
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_detail);
        
        np = (NumberPicker) findViewById(R.id.numberPicker1);
        String[] nums = new String[20];
        for(int i=0; i<nums.length; i++)
               nums[i] = Integer.toString(i);
        
        np.setMinValue(1);
        np.setMaxValue(20);
        np.setWrapSelectorWheel(false);
        np.setDisplayedValues(nums);
        np.setValue(5);
        np.setDescendantFocusability(np.FOCUS_BLOCK_DESCENDANTS);
//        mada.setTextSize(TypedValue.COMPLEX_UNIT_SP,9);
        
        Button btnChangeSize = (Button) findViewById(R.id.btnSize);
        btnChangeSize.setOnClickListener(new OnClickListener() {
			
			@Override
			public void onClick(View v) {
				// TODO Auto-generated method stub
				Log.d("Test",""+np.getValue());
				mada.setTextSize(TypedValue.COMPLEX_UNIT_SP,np.getValue()-1);
			}
		});
        
    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        getMenuInflater().inflate(R.menu.activity_detail, menu);
        return true;
    }
    
    
    
}
